//
// Created by user on 2022/3/7.
//
#include <vector>
#include <algorithm>
using namespace std;
int findMaxConsecutiveOnes(vector<int>& nums) {
   int ans = 0;
   int left =0;
   int right =0;
   while (right<nums.size()){
       if(nums[right]==0){
           ans = max(ans, right-left);
           left = right+1;
       }
       right++;
   }
    return  max(ans, right - left);
}